
package com.audi.user.model;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.Table;

import org.apache.commons.lang.builder.EqualsBuilder;
import org.apache.commons.lang.builder.HashCodeBuilder;
import org.apache.commons.lang.builder.ToStringBuilder;
import org.apache.commons.lang.builder.ToStringStyle;
import org.hibernate.annotations.GenericGenerator;


@Entity
@Table(name = "tbl_province")
public class Province implements java.io.Serializable{
    
	private static final long serialVersionUID = 5454155825314635342L;
	
	
    /**
     * provinceId       db_column: province_id 
     */ 	
	
	private Long provinceId;
    /**
     * name       db_column: name 
     */ 	
	//@Length(max=32)
	private java.lang.String name;
	//columns END


	public Province(){
	}

	public Province(
		Long provinceId
	){
		this.provinceId = provinceId;
	}

	

	public void setProvinceId(Long value) {
		this.provinceId = value;
	}
	
	@Id 
	//@SequenceGenerator(name="province_SEQ",sequenceName="seq_province")
   // @GeneratedValue(strategy=GenerationType.SEQUENCE,generator="province_SEQ") 
	@GenericGenerator(name="custom-id", strategy = "identity")
    @GeneratedValue(generator="custom-id")
	@Column(name = "province_id", unique = false, nullable = false, insertable = true, updatable = true, length = 22)
	public Long getProvinceId() {
		return this.provinceId;
	}
	
	@Column(name = "name", unique = false, nullable = true, insertable = true, updatable = true, length = 32)
	public java.lang.String getName() {
		return this.name;
	}
	
	public void setName(java.lang.String value) {
		this.name = value;
	}
	

	public String toString() {
		return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
			.append("ProvinceId",getProvinceId())
			.append("Name",getName())
			.toString();
	}
	
	public int hashCode() {
		return new HashCodeBuilder()
			.append(getProvinceId())
			.toHashCode();
	}
	
	public boolean equals(Object obj) {
		if(obj instanceof Province == false) return false;
		if(this == obj) return true;
		Province other = (Province)obj;
		return new EqualsBuilder()
			.append(getProvinceId(),other.getProvinceId())
			.isEquals();
	}
}

